﻿#ifndef MIDREGIONGROUPFORM_H
#define MIDREGIONGROUPFORM_H

#include <QWidget>
#include "taskeditor.h"
#include"taskmanager.h"
#include<qmath.h>
namespace Ui {
class MidRegionGroupForm;
}

class MidRegionGroupForm : public QWidget,public TaskEditor
{
    Q_OBJECT

public:
    explicit MidRegionGroupForm(QWidget *parent = 0);
    ~MidRegionGroupForm();

private:
    enum TableCol
    {
        Table_Name = 0,
        Table_EWStart,
        Table_EWEnd,
        Table_NSStart,
        Table_NSEnd,
        Table_STime,
        Table_MidTime,
        Table_ETime,
        Table_TotTime,
    };

    Ui::MidRegionGroupForm *ui;
    double ewoldstart;
    double ewoldend;
    double nsoldstart;
    double nsoldend;
    double rlx[2];
    // TaskEditor interface
public:
    void generateTask(TaskItem *pTask);
   void setCurrentMode(int nMode);
   void setCurrentTask(const QString& sName);
    void updateTask(TaskItem *pTask);
private slots:
    void on_pushButton_AddRegion_clicked();
    void on_pushButton_RemoveRegion_clicked();
    void on_pushButton_AddCycle_clicked();
    void on_pushButton_DeCycle_clicked();
    void on_pushButton_CalPos_clicked();
    void on_comboBox_TimeAlign_currentIndexChanged(int index);
    void on_tableWidget_Command_currentCellChanged(int currentRow, int currentColumn, int previousRow, int previousColumn);

private:
};

#endif // MIDREGIONGROUPFORM_H
